package com.example.springboot_08_thymeleaf.service;

import com.example.springboot_08_thymeleaf.entity.Comment;
import com.example.springboot_08_thymeleaf.mapper.commentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class service {
    @Autowired
    private commentMapper commentMapper;
    public List<Comment> findAllPage(int page, int size){
        Pageable pageable = PageRequest.of(page,size);
        return commentMapper.findAll(pageable).getContent();
    }

}
